package com.ruoyi.controller;

import com.ruoyi.libb.entity.User;
import com.ruoyi.libb.utils.Result;
import com.ruoyi.service.LoginService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.UnsupportedEncodingException;

@RestController
@RequestMapping("/user")
public class LoginController {

    @Resource
    private LoginService loginService;

    @RequestMapping("/login")
    public Result login(@RequestBody User user) throws UnsupportedEncodingException {

        return loginService.login(user);
    }

}
